package cc.freedem.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import cc.freedem.service.LoginService;

@Controller
public class LoginController {
    @Autowired
    private LoginService loginService;

    @RequestMapping("/")
    public String index() {
        return "login";
    }
    @RequestMapping(value="abc",method=RequestMethod.POST)
    public String abc(String username, String password) {
        if(loginService.login(username,password)) {
            return "success";
        }
        return "fail";
    }
}
